<<<<<<< HEAD
<%@page contentType="text/html; charset=utf-8" language="java" %>
<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<!--声明文档兼容模式，表示使用IE浏览器的最新模式-->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!--设置视口的宽度(值为设备的理想宽度)，页面初始缩放值<理想宽度/可见宽度>-->
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<title>国信安图书借阅在线首页</title>
	<!-- 引入Bootstrap核心样式文件 -->
	<link href="${pageContext.request.contextPath}/static/front/css/bootstrap.css" rel="stylesheet">
	<!-- 引入layui核心样式文件 -->
	<link href="${pageContext.request.contextPath}/static/back/lib/layui/css/layui.css" rel="stylesheet">
	<!-- 引入jQuery核心js文件 -->
	<script src="${pageContext.request.contextPath}/static/front/js/jquery-1.11.3.min.js"></script>
	<!-- 引入layui核心js文件 -->
	<script src="${pageContext.request.contextPath}/static/back/lib/layui/layui.js"></script>
	<script src="${pageContext.request.contextPath}/static/front/js/bootstrap.min.js"></script>

	<style>
		body {
			margin-top: 20px;
			margin: 0 auto;
		}

		font {
			color: #666;
			font-size: 22px;
			font-weight: normal;
			padding-right: 17px;
		}

		label.error {
			background: url(${pageContext.request.contextPath}/static/front/img/unchecked.gif) no-repeat 10px;
			color: red;
			padding-left: 30px;
		}

		label.success {
			background: url(${pageContext.request.contextPath}/static/front/img/checked.gif) no-repeat 10px;
		}
	</style>
=======
<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <!--声明文档兼容模式，表示使用IE浏览器的最新模式-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--设置视口的宽度(值为设备的理想宽度)，页面初始缩放值<理想宽度/可见宽度>-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>图书在线首页</title>

    <!-- 引入Bootstrap核心样式文件 -->
    <link href="${pageContext.request.contextPath}/static/front/css/bootstrap.css" rel="stylesheet">
    <!-- 引入jQuery核心js文件 -->
    <script src="${pageContext.request.contextPath}/static/front/js/jquery-1.11.3.min.js"></script>
    <!-- 引入BootStrap核心js文件 -->
    <script src="${pageContext.request.contextPath}/static/front/js/bootstrap.min.js"></script>

    <script src="${pageContext.request.contextPath}/static/back/lib/layui/layui.js" charset="utf-8"></script>
    <link href="${pageContext.request.contextPath}/static/back/lib/layui/css/layui.css" rel="stylesheet">

    <style>
        body {
            margin-top: 20px;
            margin: 0 auto;
        }

        font {
            color: #666;
            font-size: 22px;
            font-weight: normal;
            padding-right: 17px;
        }

        label.error {
            background: url(${pageContext.request.contextPath}/static/front/img/unchecked.gif) no-repeat 10px;
            color: red;
            padding-left: 30px;
        }

        label.success {
            background: url(${pageContext.request.contextPath}/static/front/img/checked.gif) no-repeat 10px;
        }
    </style>
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
</head>

<body>

<<<<<<< HEAD
<!--logo部分-->
<div class="container">
	<div class="col-lg-4 col-md-4 col-sm-6">
		<img src="${pageContext.request.contextPath}/static/front/img/logo.jpg"/>
	</div>
	<div class="col-lg-5 col-md-5 hidden-xs col-sm-6">

	</div>
	<div class="col-md-3 text-right" style="padding-top:30px">
		<ol class="list-inline">
			<li>
				<a href="${pageContext.request.contextPath}/index?m=loginPage">已有账号,立即登录</a>
			</li>
		</ol>
	</div>
</div>

<!--主体部分-->
<div class="container" style="height: 650px;">
	<div class="row">
		<div class="col-md-1"></div>
		<div class="col-md-7" style="background:#fff;padding:40px 50px;margin:30px;border:0px solid #ccc;">
			<font>会员注册</font>USER REGISTER
			<hr/>
			<form id="regForm" class="form-horizontal layui-form" style="margin-top:5px;" method="post">
				<div class="form-group">
					<label for="username" class="col-sm-2 control-label">用户名</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="username" id="username" placeholder="请输入用户名">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="username"></label>
					</div>
				</div>
				<div class="form-group">
					<label for="password" class="col-sm-2 control-label">密码</label>
					<div class="col-sm-5">
						<input type="password" class="form-control" name="password" id="password" placeholder="请输入密码">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="password"></label>
					</div>
				</div>
				<div class="form-group">
					<label for="confirmpwd" class="col-sm-2 control-label">确认密码</label>
					<div class="col-sm-5">
						<input type="password" class="form-control" name="confirmpwd" id="confirmpwd"
							   placeholder="请输入确认密码">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="confirmpwd"></label>
					</div>
				</div>
				<div class="form-group">
					<label for="email" class="col-sm-2 control-label">Email</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="email" id="email" placeholder="Email">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="email"></label>
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="name" id="name" placeholder="请输入姓名">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="name"></label>
					</div>
				</div>
				<div class="form-group">
					<label for="telephone" class="col-sm-2 control-label">联系电话</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" id="telephone" name="telephone">
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="telephone"></label>
					</div>
				</div>

				<div class="form-group">
					<label for="validateCode" class="col-sm-2 control-label">验证码</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" id="validatecode" name="validatecode">
					</div>
					<div class="col-sm-2">
						<img id="loginform:vCode"
							 src="${pageContext.request.contextPath}/front/validatecode?time=" +Math.random()
							 onclick="javascript:document.getElementById('loginform:vCode').src='${pageContext.request.contextPath}/front/validatecode?time='+Math.random();"/>
					</div>
					<div class="col-sm-4" style="padding: 5px 0;">
						<label class="error" for="validateCode"></label>
					</div>
				</div>
				<div class="col-sm-4 col-sm-offset-2" style="color:red;padding-bottom: 15px">
					&nbsp;
				</div>
				<div class="form-group">
					<div class="col-sm-offset-1 col-sm-6">
						<input class="btn btn-success btn-block" lay-submit lay-filter="register" value="立即注册"/>
					</div>
				</div>
			</form>
		</div>
	</div>
=======
<!-- 头部页面 -->
<jsp:include page="header.jsp"/>

<!--主体部分-->
<div class="container" style="height: 650px;">
    <div class="row">
        <div class="col-md-1"></div>
        <div class="col-md-7" style="background:#fff;padding:40px 50px;margin:30px;border:0px solid #ccc;">
            <font>会员注册</font>USER REGISTER
            <hr/>
            <form id="regForm" class="form-horizontal" style="margin-top:5px;"
                   method="post">
                <div class="form-group">
                    <label for="username" class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-5">
                        <p id="msg1">
                            <input type="text" class="form-control" name="username" id="username" placeholder="请输入用户名" required />
                        </p>
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="username"></label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="password" class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" name="password" id="password" placeholder="请输入密码">
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="password"></label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="confirmpwd" class="col-sm-2 control-label">确认密码</label>
                    <div class="col-sm-5">
                        <input type="password" class="form-control" id="confirmpwd" placeholder="请输入确认密码" >
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="confirmpwd"></label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="email" class="col-sm-2 control-label">Email</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="email" id="email" placeholder="Email" >
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="email"></label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="name" class="col-sm-2 control-label">姓名</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" name="name" id="name" placeholder="请输入姓名" >
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="name"></label>
                    </div>
                </div>
                <div class="form-group">
                    <label for="telephone" class="col-sm-2 control-label">联系电话</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" id="telephone" name="telephone" >
                    </div>
                    <div class="col-sm-4" style="padding: 5px 0;">
                        <label class="error" for="telephone"></label>
                    </div>
                </div>

                <div class="form-group">
                    <label for="validateCode" class="col-sm-2 control-label">验证码</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" id="validateCode" name="validateCode" >
                    </div>
                    <div class="col-sm-2">
                        <img id="loginform:vCode" src="${pageContext.request.contextPath}/front/validatecode"
                             onclick="javascript:document.getElementById('loginform:vCode').src='${pageContext.request.contextPath}/front/validatecode?'+Math.random();"/>
                    </div>
                </div>
                <div class="col-sm-4 col-sm-offset-2" style="color:red;padding-bottom: 15px">
                    &nbsp;
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-6">
                        <input class="btn btn-success btn-block" id="registerbtn" type="button" value="立即注册"/>
                    </div>
                </div>
            </form>
        </div>
    </div>
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
</div>

<hr/>

<!--友情链接和版权信息-->
<div class="container" style="margin-top: 10px;">
<<<<<<< HEAD
	<div class="row">
		<div class="" align="center">
			<ul class="list-inline">
				<li><a>关于我们</a></li>
				<li><a>联系我们</a></li>
				<li><a>招贤纳士</a></li>
				<li><a>法律声明</a></li>
				<li><a>友情链接</a></li>
				<li><a>支付方式</a></li>
				<li><a>配送方式</a></li>
				<li><a>服务声明</a></li>
				<li><a>广告声明</a></li>
			</ul>
		</div>
		<div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
			Copyright &copy; 2003-2017 国信安书城 版权所有
		</div>
	</div>
=======
    <div class="row">
        <div class="" align="center">
            <ul class="list-inline">
                <li><a>关于我们</a></li>
                <li><a>联系我们</a></li>
                <li><a>招贤纳士</a></li>
                <li><a>法律声明</a></li>
                <li><a>友情链接</a></li>
                <li><a>支付方式</a></li>
                <li><a>配送方式</a></li>
                <li><a>服务声明</a></li>
                <li><a>广告声明</a></li>
            </ul>
        </div>
        <div style="text-align: center;margin-top: 5px;margin-bottom:20px;">
            Copyright &copy; 2003-2017 书城 版权所有
        </div>
    </div>
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8
</div>

</body>
<script>
<<<<<<< HEAD

	layui.use('form',function () {
		let form = layui.form;
		form.on('submit(register)',function (data) {

			$.ajax({
				url:'${pageContext.request.contextPath}/front/register',
				type:"post",
				data:data.field,
				dataType: "json",
				success:function (res) {
					if (res.code == 100){
						layer.msg(res.msg,{icon:1,time:2000},function () {
							//location.href = '${pageContext.request.contextPath}/front/user?m=registerSuccessPage';
						})
					}else{
						layer.msg(res.msg,{icon:2,time:2000})
					}
				}

			})
			return false;
		})
	})

=======
    var layer;
    layui.use('layer', function () {
        layer = layui.layer;
    })

    $('#registerbtn').click(function () {
        var username = $('#username').val();
        var password = $('#password').val();
        var email = $('#email').val();
        var name = $('#name').val();
        var telephone = $('#telephone').val();
        var validateCode = $('#validateCode').val();

        if (username == null || username == ""){
            layer.alert("用户名不能为空");
        }else if (password == null || password == ""){
            layer.alert("密码不能为空");
        }else if (email == null || email == ""){
            layer.alert("邮箱不能为空");
        }else if (name == null || name == ""){
            layer.alert("名称不能为空");
        }else if (telephone == null || telephone == ""){
            layer.alert("名称不能为空");
        }else if (validateCode == null || validateCode == ""){
            layer.alert("请输入验证码");
        }
            var data = {'username': username, 'password': password,'email':email,'name':name,'telephone':telephone,'validateCode':validateCode}
            $.ajax({
                url: '${pageContext.request.contextPath}/front/register',
                type: 'POST',
                data: data,
                dataType: 'json',
                success: function (res) {
                    console.log(res.code);
                    if (res.code === 100) {
                        window.location.href = '${pageContext.request.contextPath}/front/registSuccess';
                    }else if(res.code == 101){
                        layer.alert(res.message,5000);
                    }
                }
            })


    })


    //用户名失去焦点验证
    $(function () {
        $("input[name=username]").blur(function () {
            // alert(this.value());
            var username = this.value;
            $.ajax({
                url: '${pageContext.request.contextPath}/front/chackusername',
                type: "post",
                data: {username: username},//前一个email是指后端获得的数据的变量名，保持一直
                dataType: "json",
                success: function (res) {
                    //成功后的回调函数，接收从后端传过来的数据
                    if (res.code == 101) {
                        // layer.alert(res.message);
                        // $("#msg1").html(res.message);

                        $("#msg").remove();
                        $("#msg1").append("<p id='msg' style='color: red'>" + res.message + "</p>");
                        // alert(res.msg)
                    }
                    if (res.code == 100) {
                        // $("#msg2").html(res.message);
                        $("#msg").remove();
                        $("#msg1").append("<p id='msg' style='color: green'>" + res.message + "</p>");
                        // alert(res.msg)
                    }
                }
            })
        });
    })
>>>>>>> 180ace60693232df69575b4f82fc34aeb3fc90e8

</script>
</html>